
#import "HomePage.h"

@implementation HomePage

+(CCScene *) scene
{
	// 'scene' is an autorelease object.
	CCScene *scene = [CCScene node];
	
	// 'layer' is an autorelease object.
	HomePage *layer = [HomePage node];
	
	// add layer as a child to scene
	[scene addChild: layer];
	
	// return the scene
	return scene;
}

-(void)Game_Bottle:(id)sender
{
	if(delegate)
	{
		[delegate HomePageSelect:EHomePageSelect_Bottle];
	}
}

-(void)Game_Cup:(id)sender
{
	if(delegate)
	{
		[delegate HomePageSelect:EHomePageSelect_Cup];
	}
}

-(void)Game_Cards:(id)sender
{
	if(delegate)
	{
		[delegate HomePageSelect:EHomePageSelect_Cards];
	}
}

-(id)init:(id<HomePageDelegate>) _delegate
{
	self = [super init];
	if (self)
	{
		delegate = _delegate;
		//CGSize size = [[CCDirector sharedDirector] winSize];
		
		[CCMenuItemFont setFontName:@"Arial"];
		
		[CCMenuItemFont setFontSize:40];
		
		CCMenuItem *Game1 = [CCMenuItemFont itemFromString:@"转酒瓶"		target:self selector:@selector(Game_Bottle:)];
		//CCMenuItem *Game2 = [CCMenuItemFont itemFromString:@"推杯子"		target:self selector:@selector(Game_Cup:)];
		CCMenuItem *Game3 = [CCMenuItemFont itemFromString:@"纸牌大小"	target:self selector:@selector(Game_Cards:)];
		
		CCMenu *mn = [CCMenu menuWithItems:Game1, Game3, nil];
		
		[mn alignItemsVerticallyWithPadding:40];
		
		[self addChild:mn z:1 tag:2];
		
	}
	return self;
}

- (void) dealloc
{
	
	[super dealloc];
}

- (void)layerReplaced
{
	
}

@end
